package com.extension.company.view.store;

import android.content.Context;
import android.databinding.DataBindingUtil;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.extension.company.admin.R;
import com.extension.company.admin.databinding.StoreMainItemBinding;

import java.util.List;

/**
 * 作者:zwk
 * 联系方式：497981239@qq.com
 * 时间：on 2019/8/17 15:37
 * 功能：
 */
public class StoreMainAdapter extends RecyclerView.Adapter<StoreMainAdapter.StoreMainHolder> {
	private Context context;
	private List<String> list;

	public StoreMainAdapter(Context context, List<String> list) {
		this.context = context;
		this.list = list;
	}

	@NonNull
	@Override
	public StoreMainHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
		StoreMainItemBinding binding = DataBindingUtil.inflate(LayoutInflater.from(context), R.layout.store_main_item, viewGroup, false);
		return new StoreMainHolder(binding.getRoot());
	}

	@Override
	public void onBindViewHolder(@NonNull StoreMainHolder storeMainHolder, int i) {
		StoreMainItemBinding storeMainItemBinding = DataBindingUtil.getBinding(storeMainHolder.itemView);
//		storeMainItemBinding.storeItemTv.setText(list.get(i));
	}

	@Override
	public int getItemCount() {
		return list.size();
	}

	protected class StoreMainHolder extends RecyclerView.ViewHolder {
		public StoreMainHolder(@NonNull View itemView) {
			super(itemView);
		}
	}
}
